package com.mdd.system.provider;

import com.mdd.system.api.SystemAuthMenuApi;
import com.mdd.system.entity.SystemAuthMenu;
import com.mdd.system.params.GenTableParam;
import com.mdd.system.service.ISystemAuthMenuService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Description
 * @Author 幻速
 * @Date 2024/3/19 15:09
 **/
@Service
public class SystemAuthMenuApiProvider implements SystemAuthMenuApi {
    @Resource
    ISystemAuthMenuService iSystemAuthMenuService;

    @Override
    public void sava(GenTableParam genTableParam) {
        SystemAuthMenu authMenu = new SystemAuthMenu();
        authMenu.setPid(genTableParam.getMenuPid());
        authMenu.setMenuType("C");
        authMenu.setMenuName(genTableParam.getMenuName());
        authMenu.setPaths(genTableParam.getModuleName());
        authMenu.setPerms(genTableParam.getModuleName() + ":list");
        authMenu.setComponent(genTableParam.getModuleName() + "/index");
        authMenu.setMenuName(genTableParam.getMenuName());
        iSystemAuthMenuService.save(authMenu);
    }
}
